home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #9 / utv1n9s2.d64 / area code finder (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  5KB  |  146 lines

  1. 10 rem   area code finder
  2. 15 rem         by
  3. 20 rem     mike cooke
  4. 25 rem
  5. 30 rem
  6. 35 rem
  7. 40 rem
  8. 50 rem
  9. 55 poke53280,0:poke53281,0
  10. 56 printchr$(8)chr$(14)
  11. 60 print"[147][152]                                      [146]"
  12. 63 print" [146]                                     [146]"
  13. 64 print" [146]          [158][193]rea [195]ode [198]inder[152]           [146]"
  14. 65 print" [146]                                     [146]"
  15. 66 print"                                      [146]"
  16. 69 goto100
  17. 70 rem  *** clear space ***
  18. 73 print"":fort=1to18:print"                                       ":next
  19. 74 print"":return
  20. 75 rem  *** press a key ***
  21. 76 print"[150]       press <[211][208][193][195][197]>[150] to continue"
  22. 77 getsp$:ifsp$=""then77
  23. 78 ifsp$<>" "then77
  24. 79 return
  25. 80 rem  *** input routine ***
  26. 81 poke204,0:cn=0:ii$="":i$=""
  27. 82 cn=cn+1
  28. 83 geti$:ifi$=""then83
  29. 84 if i$="[140]" then 455
  30. 85 ifi$=chr$(13)thenprint" ";:poke204,1:return
  31. 87 ifi$=chr$(20)andcn>1thencn=cn-2:ii$=left$(ii$,cn):printchr$(20);:i$="":goto82
  32. 88 if cn=26 then 83
  33. 89 ifi$<>" "andi$<"0"ori$>"z"then83
  34. 92 ifcn=1and i$<>" "thenprintchr$(asc(i$)+32);:goto95
  35. 93 ifright$(ii$,1)=" "and i$<>" "thenprintchr$(asc(i$)+32);:goto95
  36. 94 printi$;
  37. 95 ii$=ii$+i$:i$="":goto82
  38. 100 rem  *** instructions ***
  39. 101 print"[154]        [215]ritten by [205]ike [195]ooke"
  40. 102 print"         (c) [195]opyright 1987"
  41. 103 print" [208]ublished by [211]oftdisk [208]ublishing, [201]nc."
  42. 105 print"   [159][196]o you want instructions? (y/n)? ";
  43. 110 getyn$:ifyn$=""then110
  44. 115 ifyn$="n"then200
  45. 116 ifyn$<>"y"then110
  46. 117 gosub70
  47. 118 print"[152]     [212]his program's purpose is to give"
  48. 119 print"you the area code for a city or state."
  49. 120 print"[212]o use it, simply choose the area of"
  50. 121 print"[206]orth [193]merica that you need and then"
  51. 122 print"enter the state/province that you want"
  52. 123 print"the area code of.  [201]n those places"
  53. 124 print"that have more than one code in them,"
  54. 125 print"you must enter the name of the city"
  55. 126 print"you want.  [201]t is then compared"
  56. 127 print"with the data on the disk for that"
  57. 128 print"state/province.  [201]n later issues of"
  58. 129 print"[213]p[212]ime, there will be bonus files that"
  59. 130 print"can be used with this program but that"
  60. 131 print"have many[152] more cities for each state."
  61. 132 gosub75:gosub70
  62. 133 print"     [152][201]nstead of entering the full name"
  63. 134 print"of a state or province, you may enter"
  64. 135 print"their postal code. [198]or example, instead"
  65. 136 print"of typing [211][193][211][203][193][212][195][200][197][215][193][206], you may enter"
  66. 137 print"[211][203].  [207]ne note about [206]ew [217]ork [195]ity, it"
  67. 138 print"isn't in file--you must enter the name"
  68. 139 print"of the island you want, such as, [194]ronx"
  69. 140 print"[194]rooklyn, [205]anhattan, [209]ueens, or [211]taten"
  70. 141 print"[201]s."
  71. 150 gosub75:gosub70:goto100
  72. 200 rem *** menu ***
  73. 205 gosub70:print"[155]              [205]ain [205]enu":print:print
  74. 207 printtab(10)"[155]1)  [152][213]nited [211]tates/[195]anada":print
  75. 209 printtab(10)"[155]2)  [152][195]aribbean [201]slands":print
  76. 211 printtab(10)"[155]3)  [152][205]exico":print
  77. 212 printtab(10)"[155]4)  [152][213]p[212]ime [204]and":print:print
  78. 215 printtab(14)"[155][217]our choice? ";
  79. 217 getyn$:ifyn$=""then217
  80. 218 ifval(yn$)<1orval(yn$)>4then217
  81. 219 printyn$
  82. 220 onval(yn$)goto250,350,400,450
  83. 250 rem *** us or canada ***
  84. 255 gosub70:print"[155]          [213]nited [211]tates/[195]anada":print:print
  85. 256 print"[151]       [208]ress <[210][197][212][213][210][206]> for [205]ain [205]enu":print
  86. 257 s$="":print"[152]       [211]tate: ";:gosub80:s$=ii$:print:print:ifs$=""then200
  87. 259 print"       [211]earching...";
  88. 262 open15,8,15:open1,8,2,"states,s,r":input#15,a,b$
  89. 265 ifa<20then269
  90. 266 print"[196][201][211][203][160][197][210][210][207][210]!!!":print:printtab(10)"[152][208]lease check drive"
  91. 267 printtab(10)"and correct error.":gosub75:close1:close15:goto250
  92. 269 input#1,a$:a$=""
  93. 270 fort=1to60:input#1,a$:ifleft$(a$,2)=s$ormid$(a$,4,(len(a$)-7))=s$then275
  94. 271 nextt:print"[211]tate not found":close1:close15:gosub75:goto250
  95. 275 close1:close15:print"[198]ound ";:print"[152]";chr$(asc(mid$(a$,4,1))+32);
  96. 276 fort=5to(len(a$)-4):ifmid$(a$,t-1,1)=" "thenprintchr$(asc(mid$(a$,t,1))+32);
  97. 277 ifmid$(a$,t-1,1)<>" "thenprintmid$(a$,t,1);
  98. 278 nextt:print:print
  99. 279 ifval(right$(a$,3))=0then285
  100. 280 printtab(7)"[193]ll points: [150]";right$(a$,3):gosub75:goto250
  101. 285 print"       [152][212]his state requires a city"
  102. 286 print"       name.  [215]ill you be using"
  103. 287 print"       an [155][207]riginal[152] or [155][194]onus[152] file?"
  104. 288 print"       (o/b)? ";
  105. 289 getyn$:ifyn$=""then289
  106. 290 ifyn$="o"thenprint"[155][207]riginal.":goto300
  107. 291 ifyn$<>"b"then289
  108. 292 print"[155][194]onus.":fort=1to500:next:print"[145][145][145][145][145]"
  109. 293 fort=1to4:print"                                       ":next:print"[145][145][145][145][145][145]"
  110. 296 print:print"       [201]nsert disk with [194]onus file.":gosub75
  111. 297 print"[145][145][145][145]"
  112. 298 fort=1to3:print"                                       ":next:print"[145][145][145][145]"
  113. 299 goto310
  114. 300 fort=1to500:next:print"[145][145][145][145][145]"
  115. 302 fort=1to4:print"                                       ":next:print"[145][145][145][145][145]"
  116. 310 print"       [152][195]ity:                    [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";:gosub80
  117. 311 c$=ii$:ifc$=""then200
  118. 312 print:print:print"       [211]earching...";
  119. 314 open15,8,15:open1,8,2,left$(a$,2)+",s,r":input#15,a,b$:ifa<20then320
  120. 315 print"[196][201][211][203] [197][210][210][207][210]!!!":printtab(10)"[152]please check drive":close1:close15
  121. 316 printtab(10)"and correct error.":gosub75
  122. 317 print"[145][145][145][145][145][145][145]":fort=1to6:print"                                       "
  123. 318 nextt:print"[145][145][145][145][145][145][145][145]":goto310
  124. 320 input#1,ct:fort=1toct:input#1,a$:ifc$=left$(a$,(len(c$)))then324
  125. 321 nextt:print"[195]ity not found":close1:close15:gosub75:ifyn$="b"then331
  126. 322 goto250
  127. 324 close1:close15:print"[198]ound ";:print"[152]";chr$(asc(mid$(a$,1,1))+32);
  128. 325 fort=2to(len(a$)-4):ifmid$(a$,t-1,1)=" "thenprintchr$(asc(mid$(a$,t,1))+32);
  129. 326 ifmid$(a$,t-1,1)<>" "thenprintmid$(a$,t,1);
  130. 327 nextt:print:print
  131. 329 print"[152]       [193]rea code is: [150]";right$(a$,3)
  132. 330 gosub75:ifyn$="o"thengoto250
  133. 331 gosub70:print"[155]     [210]e-insert original program disk.":gosub75:goto250
  134. 350 rem *** caribbean is. ***
  135. 355 gosub70:print"[155]            [195]aribbean [201]s.":print:print:print
  136. 360 print"[152]          [208]uerto [210]ico: [150]809":print
  137. 365 print"[152]          [214]irgin [201]s.:  [150]809":print:print
  138. 370 gosub75:goto200
  139. 400 rem *** mexico ***
  140. 405 gosub70:print"[155]              [205]exico":print:print:print
  141. 410 print"[152]       [205]exico [195]ity:      [150]905"
  142. 415 print:print"[152]       [193]ll other points: [150]706":print:print
  143. 420 gosub75:goto200
  144. 450 rem *** uptime land ***
  145. 455 poke204,1:sys(8*4096)+4
  146.